﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Prism.Mvvm;

namespace Electronic_Catalog_XML_Generator_Libs.models
{
    public class FileModel : BindableBase
    {
        private string _iconAddr;
        [Category("路径配置")]
                [DisplayName("图标地址")]
        [Description("标识ICON地址信息")]
       
        public string IconAddr
        {
            get { return _iconAddr; }
            set { SetProperty(ref _iconAddr, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("IconAddr", IconAddr);
                }
            }
        }
        private string _previewAddr;
        [Category("路径配置")]
        [DisplayName("预览地址")]
        [Description("标识Preview地址信息")]
        public string PreviewAddr
        {
            get { return _previewAddr; }
            set { SetProperty(ref _previewAddr, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("PreviewAddr", PreviewAddr);
                }
            }
        }
        private bool canNotify;
        [Browsable(false)]
        public bool CanNotify
        {
            get { return canNotify; }
            set { SetProperty(ref canNotify, value); }
        }
        private string? _filename;
        /// <summary>
        /// 文件名
        /// </summary>
        [Category("Main")]
        [DisplayName("文件名")]
        [Description("标识Name信息")]
        public string? Name
        {
            get { return _filename; }
            set { SetProperty(ref _filename, value);
            }
        }
        private string? _description;

        //描述
        [DisplayName("描述信息")]
        [Description("标识Description信息")]
        public string? Description
        {
            get { return _description; }
            set { SetProperty(ref _description, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Description", Description);
                }
            }
        }
        private string? _type;
        //类型？不知道什么东西
        [Category("Main")]
        [DisplayName("类型")]
        [Description("标识Type信息")]
        public string? Type
        {
            get { return _type; }
            set
            {
                SetProperty(ref _type, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Type", Type);
                }

            }
        }
        private string? _manufacturer;

        //制造商
        [Category("Main")]
        [DisplayName("制造商")]
        [Description("标识Manufacturer信息")]
        public string? Manufacturer
        {
            get { return _manufacturer; }
            set
            {
                SetProperty(ref _manufacturer, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Manufacturer", Manufacturer);
                }
            }
        }


        private string? _maxPayload;

        //最大有效载荷
        [DisplayName("最大有效载荷")]
        [Description("标识MaxPayLoad信息")]
        public string? MaxPayLoad
        {
            get { return _maxPayload; }
            set { SetProperty(ref _maxPayload, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("MaxPayLoad", MaxPayLoad);
                }
            }
        }

        private string? _reach;
        // 不知道什么
        [DisplayName("范围")]
        [Description("标识Reach信息")]
        public string? Reach
        {
            get { return _reach; }
            set { SetProperty(ref _reach, value); }
        }
        private string? _author;
        //作者
        [Category("Auth")]
        [DisplayName("作者")]
        public string? Author
        {
            get { return _author; }
            set { SetProperty(ref _author, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Author", Author);
                }
            }
        }

        private string? _email;
        //邮箱
        [Category("Auth")]
        [DisplayName("邮箱")]
        public string? Email
        {
            get { return _email; }
            set { SetProperty(ref _email, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Email", Email);
                }
            }
        }
        private string? _website;
        // 网站
        [Category("Auth")]
        [DisplayName("网站")]
        public string? Website
        {
            get { return _website; }
            set { SetProperty(ref _website, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Website", Website);
                }
            }
        }

        private string? _detailedRevision;
        //vc详细修订版本
        [DisplayName("详细修订版本")] 
        public string? DetailedRevision
        {
            get { return _detailedRevision; }
            set { SetProperty(ref _detailedRevision, value); }
        }
        private string? _revision;
        //修订版本
        [DisplayName("修订版本")]
        public string? Revision
        {
            get { return _revision; }
            set { SetProperty(ref _revision, value); }
        }


        private string? _vcid;

        public string? VcId
        {
            get { return _vcid; }
            set { SetProperty(ref _vcid, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("VcId", VcId);
                }
            }
        }

        private string? _isDeprecated;

        //是否弃用？
        [DisplayName("启用状态")]
        public string? IsDeprecated
        {
            get { return _isDeprecated; }
            set { SetProperty(ref _isDeprecated, value); }
        }
        private string? _tags;
        [DisplayName("标记")]
        public string Tags
        {
            get { return _tags; }
            set { SetProperty(ref _tags, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("Tags", Tags);
                }
            }
        }

        private string? _file;
        /// <summary>
        /// 文件路径
        /// </summary>
        [Category("路径配置")]
        [DisplayName("文件地址")]
        public string? File
        {
            get { return _file; }
            set
            {
                SetProperty(ref _file, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("File", File);
                }
            }
        }
        private string? _icon;
        /// <summary>
        /// 图标路径
        /// </summary>
        [Category("Main")]
        [DisplayName("图标")]
        public string? Icon
        {
            get { return _icon; }
            set { SetProperty(ref _icon, value); }
        }

        private string _previewIcon;
        /// <summary>
        /// 预览图标路径
        /// </summary>
        [Category("Main")]
        [DisplayName("预览图标")]
        public string PreviewIcon
        {
            get { return _previewIcon; }
            set { SetProperty(ref _previewIcon, value); }
        }

        private string? _dateModified;

        [DisplayName("修改日期")]
        public string? DateModified
        {
            get { return _dateModified; }
            set { SetProperty(ref _dateModified, value); }
        }
        private string? _fileSize;
        [DisplayName("文件大小")]
        public string? FileSize
        {
            get { return _fileSize; }
            set { SetProperty(ref _fileSize, value); }
        }
        private string? _modelType;
        [DisplayName("型号")]
        public string? ModelType
        {
            get { return _modelType; }
            set { SetProperty(ref _modelType, value);
                if (CanNotify)
                {
                    NotifyPropertyChanged?.Invoke("ModelType", ModelType);
                }
            }
        }
        private string _nameAndexc;
        [Browsable(false)]
        public string NameAndExc
        {
            get { return _nameAndexc; }
            set { SetProperty(ref _nameAndexc, value); }
        }
        private string _fileFullPath;
        [Browsable(false)]
        public string FileFullPath
        {
            get { return _fileFullPath; }
            set { SetProperty(ref _fileFullPath, value); }
        }



        [Browsable(false)]
        public Action<string, string> NotifyPropertyChanged { get; set; }
    }
}
